<template>
  <div>
    <!-- 吸顶头部组件 -->
    <AppHeaderSticky />
    <!-- 顶部通栏 -->
    <AppNavbar />
    <!-- 头部组件 -->
    <AppHeader />
    <!-- 内容容器 -->
    <div class="main">
      <!-- 二级路由 -->
      <RouterView />
    </div>
    <!-- 底部组件 -->
    <button @click="$store.commit('user/setUser',{})">退出</button>
    <button @click="$store.commit('user/setUser',{account:'zhou',token:123})">登录</button>
    <br>
    <br>
    <br>
    <br>
    <br>
    <AppFooter />

  </div>
</template>

<script>
import AppNavbar from '@/components/app-navbar.vue'
import AppHeader from '@/components/app-header.vue'
import AppFooter from '@/components/app-footer.vue'
import AppHeaderSticky from '@/components/app-header-sticky.vue'
import { useStore } from 'vuex'
export default {
  name: 'Layout',
  components: {
    AppNavbar, AppHeader, AppFooter, AppHeaderSticky
  },
  // 获取下分类数据
  setup() {
    const store = useStore()
    store.dispatch('category/getList')
  }
}
</script>

<style lang="less" scoped>
</style>